home *** CD-ROM | disk | FTP | other *** search
- unit DrBob42_c;
-
- {This file was generated on 29 Dec 2000 10:39:41 GMT by version 03.03.03.C1.06}
- {of the Inprise VisiBroker idl2pas CORBA IDL compiler. }
-
- {Please do not edit the contents of this file. You should instead edit and }
- {recompile the original IDL which was located in the file }
- {C:\DrBob42\Drbob42.idl. }
-
- {Delphi Pascal unit : DrBob42_c }
- {derived from IDL module : DrBob42 }
-
-
-
- interface
-
- uses
- CORBA,
- DrBob42_i;
-
- type
- TRatesHelper = class;
- TRatesStub = class;
- TAccountHelper = class;
- TAccountStub = class;
- TAccountErrorHelper = class;
- TAccountError = class;
- EAccountException = class;
- TMyAccountHelper = class;
- TMyAccountStub = class;
- TIdentifierHelper = class;
- TEnumTypeHelper = class;
- TStructTypeHelper = class;
- TStructType = class;
- TUnionTypeHelper = class;
- TUnionType = class;
- TStructArrayHelper = class;
- TStructSequenceHelper = class;
- TADTHelper = class;
- TADTStub = class;
- TIntSeqHelper = class;
- TSeqAccountHelper = class;
- TSeqAccountStub = class;
-
- TRatesHelper = class
- class procedure Insert (var _A: CORBA.Any; const _Value : DrBob42_i.Rates);
- class function Extract(var _A: CORBA.Any) : DrBob42_i.Rates;
- class function TypeCode : CORBA.TypeCode;
- class function RepositoryId : string;
- class function Read (const _Input : CORBA.InputStream) : DrBob42_i.Rates;
- class procedure Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.Rates);
- class function Narrow(const _Obj : CORBA.CORBAObject; _IsA : Boolean = False) : DrBob42_i.Rates;
- class function Bind(const _InstanceName : string = ''; _HostName : string = '') : DrBob42_i.Rates; overload;
- class function Bind(_Options : BindOptions; const _InstanceName : string = ''; _HostName: string = '') : DrBob42_i.Rates; overload;
- end;
-
- TRatesStub = class(CORBA.TCORBAObject, DrBob42_i.Rates)
- public
- function interest_rate : Single; virtual;
- end;
-
- TAccountHelper = class
- class procedure Insert (var _A: CORBA.Any; const _Value : DrBob42_i.Account);
- class function Extract(var _A: CORBA.Any) : DrBob42_i.Account;
- class function TypeCode : CORBA.TypeCode;
- class function RepositoryId : string;
- class function Read (const _Input : CORBA.InputStream) : DrBob42_i.Account;
- class procedure Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.Account);
- class function Narrow(const _Obj : CORBA.CORBAObject; _IsA : Boolean = False) : DrBob42_i.Account;
- class function Bind(const _InstanceName : string = ''; _HostName : string = '') : DrBob42_i.Account; overload;
- class function Bind(_Options : BindOptions; const _InstanceName : string = ''; _HostName: string = '') : DrBob42_i.Account; overload;
- end;
-
- TAccountStub = class(CORBA.TCORBAObject, DrBob42_i.Account)
- public
- function balance : Single; virtual;
- function get_rates ( const myRates : DrBob42_i.Rates): Single; virtual;
- end;
-
- TAccountErrorHelper = class
- class procedure Insert (var _A: CORBA.Any; const _Value : DrBob42_i.AccountError);
- class function Extract(const _A: CORBA.Any): DrBob42_i.AccountError;
- class function TypeCode : CORBA.TypeCode;
- class function RepositoryId: string;
- class function Read (const _Input : CORBA.InputStream) : DrBob42_i.AccountError;
- class procedure Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.AccountError);
- end;
-
- TAccountError = class (TInterfacedObject, DrBob42_i.AccountError)
- private
- Balance : Single;
- ErrorMessage : AnsiString;
- constructor Create; overload;
- public
- function _get_Balance : Single; virtual;
- procedure _set_Balance ( const _value : Single ); virtual;
- function _get_ErrorMessage : AnsiString; virtual;
- procedure _set_ErrorMessage ( const _value : AnsiString ); virtual;
- constructor Create (const Balance : Single;
- const ErrorMessage : AnsiString
- ); overload;
- end;
-
- EAccountException = class(UserException)
- private
- FError : DrBob42_i.AccountError;
- protected
- function _get_Error : DrBob42_i.AccountError; virtual;
- public
- property Error : DrBob42_i.AccountError read _get_Error;
- constructor Create; overload;
- constructor Create(const Error : DrBob42_i.AccountError); overload;
- procedure Copy(const _Input : InputStream); override;
- procedure WriteExceptionInfo(var _Output : OutputStream); override;
- end;
-
- TMyAccountHelper = class
- class procedure Insert (var _A: CORBA.Any; const _Value : DrBob42_i.MyAccount);
- class function Extract(var _A: CORBA.Any) : DrBob42_i.MyAccount;
- class function TypeCode : CORBA.TypeCode;
- class function RepositoryId : string;
- class function Read (const _Input : CORBA.InputStream) : DrBob42_i.MyAccount;
- class procedure Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.MyAccount);
- class function Narrow(const _Obj : CORBA.CORBAObject; _IsA : Boolean = False) : DrBob42_i.MyAccount;
- class function Bind(const _InstanceName : string = ''; _HostName : string = '') : DrBob42_i.MyAccount; overload;
- class function Bind(_Options : BindOptions; const _InstanceName : string = ''; _HostName: string = '') : DrBob42_i.MyAccount; overload;
- end;
-
- TMyAccountStub = class(CORBA.TCORBAObject, DrBob42_i.MyAccount)
- public
- procedure deposit ( const amount : Single); virtual;
- procedure withdraw ( const amount : Single); virtual;
- function balance : Single; virtual;
- function get_rates ( const myRates : DrBob42_i.Rates): Single; virtual;
- end;
-
- TIdentifierHelper = class
- class procedure Insert (var _A: CORBA.Any; const _Value : DrBob42_i.Identifier);
- class function Extract(const _A: CORBA.Any): DrBob42_i.Identifier;
- class function TypeCode : CORBA.TypeCode;
- class function RepositoryId: string;
- class function Read (const _Input : CORBA.InputStream) : DrBob42_i.Identifier;
- class procedure Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.Identifier);
- end;
-
- TEnumTypeHelper = class
- class procedure Insert (var _A: CORBA.Any; const _Value : DrBob42_i.EnumType);
- class function Extract(const _A: CORBA.Any): DrBob42_i.EnumType;
- class function TypeCode : CORBA.TypeCode;
- class function RepositoryId: string;
- class function Read (const _Input : CORBA.InputStream) : DrBob42_i.EnumType;
- class procedure Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.EnumType);
- end;
-
- TStructTypeHelper = class
- class procedure Insert (var _A: CORBA.Any; const _Value : DrBob42_i.StructType);
- class function Extract(const _A: CORBA.Any): DrBob42_i.StructType;
- class function TypeCode : CORBA.TypeCode;
- class function RepositoryId: string;
- class function Read (const _Input : CORBA.InputStream) : DrBob42_i.StructType;
- class procedure Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.StructType);
- end;
-
- TStructType = class (TInterfacedObject, DrBob42_i.StructType)
- private
- s : SmallInt;
- l : Integer;
- i : DrBob42_i.Identifier;
- constructor Create; overload;
- public
- function _get_s : SmallInt; virtual;
- procedure _set_s ( const _value : SmallInt ); virtual;
- function _get_l : Integer; virtual;
- procedure _set_l ( const _value : Integer ); virtual;
- function _get_i : DrBob42_i.Identifier; virtual;
- procedure _set_i ( const _value : DrBob42_i.Identifier ); virtual;
- constructor Create (const s : SmallInt;
- const l : Integer;
- const i : DrBob42_i.Identifier
- ); overload;
- end;
-
- TUnionTypeHelper = class
- class procedure Insert (var _A: CORBA.Any; const _Value : DrBob42_i.UnionType);
- class function Extract(const _A: CORBA.Any): DrBob42_i.UnionType;
- class function TypeCode : CORBA.TypeCode;
- class function RepositoryId: string;
- class function Read (const _Input : CORBA.InputStream) : DrBob42_i.UnionType;
- class procedure Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.UnionType);
- end;
-
- TUnionType = class (TInterfacedObject, DrBob42_i.UnionType)
- private
- s : SmallInt;
- l : Integer;
- i : DrBob42_i.Identifier;
- _discriminator : Integer;
- public
- function _get_s : SmallInt; virtual;
- procedure _set_s ( const _value : SmallInt ); virtual;
- function _get_l : Integer; virtual;
- procedure _set_l ( const _value : Integer ); virtual;
- function _get_i : DrBob42_i.Identifier; virtual;
- procedure _set_i ( const _value : DrBob42_i.Identifier ); virtual;
- function _get_discriminator : Integer; virtual;
- constructor Create;
- end;
-
- TStructArrayHelper = class
- class procedure Insert (var _A: CORBA.Any; const _Value : DrBob42_i.StructArray);
- class function Extract(const _A: CORBA.Any): DrBob42_i.StructArray;
- class function TypeCode : CORBA.TypeCode;
- class function RepositoryId: string;
- class function Read (const _Input : CORBA.InputStream) : DrBob42_i.StructArray;
- class procedure Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.StructArray);
- end;
-
- TStructSequenceHelper = class
- class procedure Insert (var _A: CORBA.Any; const _Value : DrBob42_i.StructSequence);
- class function Extract(const _A: CORBA.Any): DrBob42_i.StructSequence;
- class function TypeCode : CORBA.TypeCode;
- class function RepositoryId: string;
- class function Read (const _Input : CORBA.InputStream) : DrBob42_i.StructSequence;
- class procedure Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.StructSequence);
- end;
-
- TADTHelper = class
- class procedure Insert (var _A: CORBA.Any; const _Value : DrBob42_i.ADT);
- class function Extract(var _A: CORBA.Any) : DrBob42_i.ADT;
- class function TypeCode : CORBA.TypeCode;
- class function RepositoryId : string;
- class function Read (const _Input : CORBA.InputStream) : DrBob42_i.ADT;
- class procedure Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.ADT);
- class function Narrow(const _Obj : CORBA.CORBAObject; _IsA : Boolean = False) : DrBob42_i.ADT;
- class function Bind(const _InstanceName : string = ''; _HostName : string = '') : DrBob42_i.ADT; overload;
- class function Bind(_Options : BindOptions; const _InstanceName : string = ''; _HostName: string = '') : DrBob42_i.ADT; overload;
- end;
-
- TADTStub = class(CORBA.TCORBAObject, DrBob42_i.ADT)
- public
- procedure test ( const one : DrBob42_i.Identifier;
- const two : DrBob42_i.EnumType;
- const three : DrBob42_i.StructType;
- const four : DrBob42_i.UnionType;
- const five : DrBob42_i.StructArray;
- const six : DrBob42_i.StructSequence); virtual;
- end;
-
- TIntSeqHelper = class
- class procedure Insert (var _A: CORBA.Any; const _Value : DrBob42_i.IntSeq);
- class function Extract(const _A: CORBA.Any): DrBob42_i.IntSeq;
- class function TypeCode : CORBA.TypeCode;
- class function RepositoryId: string;
- class function Read (const _Input : CORBA.InputStream) : DrBob42_i.IntSeq;
- class procedure Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.IntSeq);
- end;
-
- TSeqAccountHelper = class
- class procedure Insert (var _A: CORBA.Any; const _Value : DrBob42_i.SeqAccount);
- class function Extract(var _A: CORBA.Any) : DrBob42_i.SeqAccount;
- class function TypeCode : CORBA.TypeCode;
- class function RepositoryId : string;
- class function Read (const _Input : CORBA.InputStream) : DrBob42_i.SeqAccount;
- class procedure Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.SeqAccount);
- class function Narrow(const _Obj : CORBA.CORBAObject; _IsA : Boolean = False) : DrBob42_i.SeqAccount;
- class function Bind(const _InstanceName : string = ''; _HostName : string = '') : DrBob42_i.SeqAccount; overload;
- class function Bind(_Options : BindOptions; const _InstanceName : string = ''; _HostName: string = '') : DrBob42_i.SeqAccount; overload;
- end;
-
- TSeqAccountStub = class(CORBA.TCORBAObject, DrBob42_i.SeqAccount)
- public
- function balance ( const mySeq : DrBob42_i.IntSeq): Single; virtual;
- end;
-
-
- implementation
-
-
- var
-
- AccountExceptionDesc : PExceptionDescription;
-
- class procedure TRatesHelper.Insert(var _A : CORBA.Any; const _Value : DrBob42_i.Rates);
- begin
- _A := Orb.MakeObjectRef( TRatesHelper.TypeCode, _Value as CORBA.CORBAObject);
- end;
-
- class function TRatesHelper.Extract(var _A : CORBA.Any): DrBob42_i.Rates;
- var
- _obj : Corba.CorbaObject;
- begin
- _obj := Orb.GetObjectRef(_A);
- Result := TRatesHelper.Narrow(_obj, True);
- end;
-
- class function TRatesHelper.TypeCode : CORBA.TypeCode;
- begin
- Result := ORB.CreateInterfaceTC(RepositoryId, 'Rates');
- end;
-
- class function TRatesHelper.RepositoryId : string;
- begin
- Result := 'IDL:DrBob42/Rates:1.0';
- end;
-
- class function TRatesHelper.Read(const _Input : CORBA.InputStream) : DrBob42_i.Rates;
- var
- _Obj : CORBA.CORBAObject;
- begin
- _Input.ReadObject(_Obj);
- Result := Narrow(_Obj, True)
- end;
-
- class procedure TRatesHelper.Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.Rates);
- begin
- _Output.WriteObject(_Value as CORBA.CORBAObject);
- end;
-
- class function TRatesHelper.Narrow(const _Obj : CORBA.CORBAObject; _IsA : Boolean) : DrBob42_i.Rates;
- begin
- Result := nil;
- if (_Obj = nil) or (_Obj.QueryInterface(DrBob42_i.Rates, Result) = 0) then
- exit;
- if _IsA and _Obj._IsA(RepositoryId) then
- Result := TRatesStub.Create(_Obj);
- end;
-
- class function TRatesHelper.Bind(const _InstanceName : string = ''; _HostName: string = '') : DrBob42_i.Rates;
- begin
- Result := Narrow(ORB.bind(RepositoryId, _InstanceName, _HostName), True);
- end;
-
- class function TRatesHelper.Bind(_Options : BindOptions; const _InstanceName : string = ''; _HostName : string = '') : DrBob42_i.Rates;
- begin
- Result := Narrow(ORB.bind(RepositoryId, _Options, _InstanceName, _HostName), True);
- end;
-
- function TRatesStub.interest_rate : Single;
- var
- _Output: CORBA.OutputStream;
- _Input : CORBA.InputStream;
- begin
- inherited _CreateRequest('interest_rate',True, _Output);
- inherited _Invoke(_Output, _Input);
- _Input.ReadFloat(Result);
- end;
-
- class procedure TAccountHelper.Insert(var _A : CORBA.Any; const _Value : DrBob42_i.Account);
- begin
- _A := Orb.MakeObjectRef( TAccountHelper.TypeCode, _Value as CORBA.CORBAObject);
- end;
-
- class function TAccountHelper.Extract(var _A : CORBA.Any): DrBob42_i.Account;
- var
- _obj : Corba.CorbaObject;
- begin
- _obj := Orb.GetObjectRef(_A);
- Result := TAccountHelper.Narrow(_obj, True);
- end;
-
- class function TAccountHelper.TypeCode : CORBA.TypeCode;
- begin
- Result := ORB.CreateInterfaceTC(RepositoryId, 'Account');
- end;
-
- class function TAccountHelper.RepositoryId : string;
- begin
- Result := 'IDL:DrBob42/Account:1.0';
- end;
-
- class function TAccountHelper.Read(const _Input : CORBA.InputStream) : DrBob42_i.Account;
- var
- _Obj : CORBA.CORBAObject;
- begin
- _Input.ReadObject(_Obj);
- Result := Narrow(_Obj, True)
- end;
-
- class procedure TAccountHelper.Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.Account);
- begin
- _Output.WriteObject(_Value as CORBA.CORBAObject);
- end;
-
- class function TAccountHelper.Narrow(const _Obj : CORBA.CORBAObject; _IsA : Boolean) : DrBob42_i.Account;
- begin
- Result := nil;
- if (_Obj = nil) or (_Obj.QueryInterface(DrBob42_i.Account, Result) = 0) then
- exit;
- if _IsA and _Obj._IsA(RepositoryId) then
- Result := TAccountStub.Create(_Obj);
- end;
-
- class function TAccountHelper.Bind(const _InstanceName : string = ''; _HostName: string = '') : DrBob42_i.Account;
- begin
- Result := Narrow(ORB.bind(RepositoryId, _InstanceName, _HostName), True);
- end;
-
- class function TAccountHelper.Bind(_Options : BindOptions; const _InstanceName : string = ''; _HostName : string = '') : DrBob42_i.Account;
- begin
- Result := Narrow(ORB.bind(RepositoryId, _Options, _InstanceName, _HostName), True);
- end;
-
- function TAccountStub.balance : Single;
- var
- _Output: CORBA.OutputStream;
- _Input : CORBA.InputStream;
- begin
- inherited _CreateRequest('balance',True, _Output);
- inherited _Invoke(_Output, _Input);
- _Input.ReadFloat(Result);
- end;
-
- function TAccountStub.get_rates ( const myRates : DrBob42_i.Rates): Single;
- var
- _Output: CORBA.OutputStream;
- _Input : CORBA.InputStream;
- begin
- inherited _CreateRequest('get_rates',True, _Output);
- DrBob42_c.TRatesHelper.Write(_Output, myRates);
- inherited _Invoke(_Output, _Input);
- _Input.ReadFloat(Result);
- end;
-
- class procedure TAccountErrorHelper.Insert(var _A : CORBA.Any; const _Value : DrBob42_i.AccountError);
- var
- _Output : CORBA.OutputStream;
- begin
- _Output := ORB.CreateOutputStream;
- TAccountErrorHelper.Write(_Output, _Value);
- ORB.PutAny(_A, TAccountErrorHelper.TypeCode, _Output);
- end;
-
- class function TAccountErrorHelper.Extract(const _A : CORBA.Any) : DrBob42_i.AccountError;
- var
- _Input : CORBA.InputStream;
- begin
- Orb.GetAny(_A, _Input);
- Result := TAccountErrorHelper.Read(_Input);
- end;
-
- class function TAccountErrorHelper.TypeCode : CORBA.TypeCode;
- var
- _Seq: StructMemberSeq;
- begin
- SetLength(_Seq, 2);
- _Seq[0].Name := 'Balance';
- _Seq[0].TC := ORB.CreateTC(Integer(tk_float));
- _Seq[1].Name := 'ErrorMessage';
- _Seq[1].TC := ORB.CreateTC(Integer(tk_string));
- Result := ORB.MakeStructureTypecode(RepositoryID, 'AccountError', _Seq);
- end;
-
- class function TAccountErrorHelper.RepositoryId : string;
- begin
- Result := 'IDL:DrBob42/AccountError:1.0';
- end;
-
- class function TAccountErrorHelper.Read(const _Input : CORBA.InputStream) : DrBob42_i.AccountError;
- var
- _Value : DrBob42_c.TAccountError;
- begin
- _Value := DrBob42_c.TAccountError.Create;
- _Input.ReadFloat(_Value.Balance);
- _Input.ReadString(_Value.ErrorMessage);
- Result := _Value;
- end;
-
- class procedure TAccountErrorHelper.Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.AccountError);
- begin
- _Output.WriteFloat(_Value.Balance);
- _Output.WriteString(_Value.ErrorMessage);
- end;
-
- constructor TAccountError.Create;
- begin
- inherited Create;
- end;
-
- constructor TAccountError.Create(const Balance: Single;
- const ErrorMessage: AnsiString);
- begin
- Self.Balance := Balance;
- Self.ErrorMessage := ErrorMessage;
- end;
-
- function TAccountError._get_Balance: Single;
- begin
- Result := Balance;
- end;
-
- procedure TAccountError._set_Balance(const _Value : Single);
- begin
- Balance := _Value;
- end;
-
- function TAccountError._get_ErrorMessage: AnsiString;
- begin
- Result := ErrorMessage;
- end;
-
- procedure TAccountError._set_ErrorMessage(const _Value : AnsiString);
- begin
- ErrorMessage := _Value;
- end;
-
-
- function EAccountException._get_Error : DrBob42_i.AccountError;
- begin
- Result := FError;
- end;
-
-
- constructor EAccountException.Create;
- begin
- inherited Create;
- end;
-
- constructor EAccountException.Create(const Error : DrBob42_i.AccountError);
- begin
- inherited Create;
- FError := Error;
- end;
-
- procedure EAccountException.Copy(const _Input: InputStream);
- begin
- FError := DrBob42_c.TAccountErrorHelper.Read(_Input);
- end;
-
- procedure EAccountException.WriteExceptionInfo(var _Output : OutputStream);
- begin
- _Output.WriteString('IDL:DrBob42/AccountException:1.0');
- DrBob42_c.TAccountErrorHelper.Write(_Output, FError);
- end;
- function AccountException_Factory: PExceptionProxy; cdecl;
- begin
- with DrBob42_c.EAccountException.Create() do Result := Proxy;
- end;
-
- class procedure TMyAccountHelper.Insert(var _A : CORBA.Any; const _Value : DrBob42_i.MyAccount);
- begin
- _A := Orb.MakeObjectRef( TMyAccountHelper.TypeCode, _Value as CORBA.CORBAObject);
- end;
-
- class function TMyAccountHelper.Extract(var _A : CORBA.Any): DrBob42_i.MyAccount;
- var
- _obj : Corba.CorbaObject;
- begin
- _obj := Orb.GetObjectRef(_A);
- Result := TMyAccountHelper.Narrow(_obj, True);
- end;
-
- class function TMyAccountHelper.TypeCode : CORBA.TypeCode;
- begin
- Result := ORB.CreateInterfaceTC(RepositoryId, 'MyAccount');
- end;
-
- class function TMyAccountHelper.RepositoryId : string;
- begin
- Result := 'IDL:DrBob42/MyAccount:1.0';
- end;
-
- class function TMyAccountHelper.Read(const _Input : CORBA.InputStream) : DrBob42_i.MyAccount;
- var
- _Obj : CORBA.CORBAObject;
- begin
- _Input.ReadObject(_Obj);
- Result := Narrow(_Obj, True)
- end;
-
- class procedure TMyAccountHelper.Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.MyAccount);
- begin
- _Output.WriteObject(_Value as CORBA.CORBAObject);
- end;
-
- class function TMyAccountHelper.Narrow(const _Obj : CORBA.CORBAObject; _IsA : Boolean) : DrBob42_i.MyAccount;
- begin
- Result := nil;
- if (_Obj = nil) or (_Obj.QueryInterface(DrBob42_i.MyAccount, Result) = 0) then
- exit;
- if _IsA and _Obj._IsA(RepositoryId) then
- Result := TMyAccountStub.Create(_Obj);
- end;
-
- class function TMyAccountHelper.Bind(const _InstanceName : string = ''; _HostName: string = '') : DrBob42_i.MyAccount;
- begin
- Result := Narrow(ORB.bind(RepositoryId, _InstanceName, _HostName), True);
- end;
-
- class function TMyAccountHelper.Bind(_Options : BindOptions; const _InstanceName : string = ''; _HostName : string = '') : DrBob42_i.MyAccount;
- begin
- Result := Narrow(ORB.bind(RepositoryId, _Options, _InstanceName, _HostName), True);
- end;
-
- procedure TMyAccountStub.deposit ( const amount : Single);
- var
- _Output: CORBA.OutputStream;
- _Input : CORBA.InputStream;
- begin
- inherited _CreateRequest('deposit',True, _Output);
- _Output.WriteFloat(amount);
- inherited _Invoke(_Output, _Input);
- end;
-
- procedure TMyAccountStub.withdraw ( const amount : Single);
- var
- _Output: CORBA.OutputStream;
- _Input : CORBA.InputStream;
- begin
- inherited _CreateRequest('withdraw',True, _Output);
- _Output.WriteFloat(amount);
- inherited _Invoke(_Output, _Input);
- end;
-
- function TMyAccountStub.balance : Single;
- var
- _Output: CORBA.OutputStream;
- _Input : CORBA.InputStream;
- begin
- inherited _CreateRequest('balance',True, _Output);
- inherited _Invoke(_Output, _Input);
- _Input.ReadFloat(Result);
- end;
-
- function TMyAccountStub.get_rates ( const myRates : DrBob42_i.Rates): Single;
- var
- _Output: CORBA.OutputStream;
- _Input : CORBA.InputStream;
- begin
- inherited _CreateRequest('get_rates',True, _Output);
- DrBob42_c.TRatesHelper.Write(_Output, myRates);
- inherited _Invoke(_Output, _Input);
- _Input.ReadFloat(Result);
- end;
-
- class procedure TIdentifierHelper.Insert(var _A : CORBA.Any; const _Value : DrBob42_i.Identifier);
- begin
- _A := _Value;
- end;
-
- class function TIdentifierHelper.Extract(const _A : CORBA.Any) : DrBob42_i.Identifier;
- var
- _Input : InputStream;
- _Temp : AnsiString;
- begin
- Orb.GetAny(_A, _Input);
- _Input.ReadString(_Temp);
- Result := DrBob42_i.Identifier(_Temp);
- end;
-
- class function TIdentifierHelper.TypeCode : CORBA.TypeCode;
- begin
- Result := ORB.CreateAliasTC(RepositoryId, 'Identifier', ORB.CreateTC(Integer(0)));
- end;
-
- class function TIdentifierHelper.RepositoryId : string;
- begin
- Result := 'IDL:DrBob42/Identifier:1.0';
- end;
-
- class function TIdentifierHelper.Read(const _Input: CORBA.InputStream) : DrBob42_i.Identifier;
- begin
- _Input.ReadString(Result);
- end;
-
- class procedure TIdentifierHelper.Write(const _Output : CORBA.OutputStream; const _Value :DrBob42_i.Identifier);
- begin
- _Output.WriteString(_Value);
- end;
-
- class procedure TEnumTypeHelper.Insert(var _A : CORBA.Any; const _Value : DrBob42_i.EnumType);
- begin
- _A := _Value;
- end;
-
- class function TEnumTypeHelper.Extract(const _A : CORBA.Any) : DrBob42_i.EnumType;
- begin
- Result := DrBob42_i.EnumType(_A);
- end;
-
- class function TEnumTypeHelper.TypeCode : CORBA.TypeCode;
- begin
- Result := ORB.CreateEnumTC(RepositoryId, 'EnumType', ['first', 'second', 'third']);
- end;
-
- class function TEnumTypeHelper.RepositoryId: string;
- begin
- Result := 'IDL:DrBob42/EnumType:1.0';
- end;
-
- class function TEnumTypeHelper.Read(const _Input : CORBA.InputStream) : DrBob42_i.EnumType;
- var
- _Temp: Cardinal;
- begin
- _Input.ReadULong(_Temp);
- Result := DrBob42_i.EnumType(_Temp);
- end;
-
- class procedure TEnumTypeHelper.Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.EnumType);
- begin
- _Output.WriteULong(Cardinal(_Value));
- end;
-
- class procedure TStructTypeHelper.Insert(var _A : CORBA.Any; const _Value : DrBob42_i.StructType);
- var
- _Output : CORBA.OutputStream;
- begin
- _Output := ORB.CreateOutputStream;
- TStructTypeHelper.Write(_Output, _Value);
- ORB.PutAny(_A, TStructTypeHelper.TypeCode, _Output);
- end;
-
- class function TStructTypeHelper.Extract(const _A : CORBA.Any) : DrBob42_i.StructType;
- var
- _Input : CORBA.InputStream;
- begin
- Orb.GetAny(_A, _Input);
- Result := TStructTypeHelper.Read(_Input);
- end;
-
- class function TStructTypeHelper.TypeCode : CORBA.TypeCode;
- var
- _Seq: StructMemberSeq;
- begin
- SetLength(_Seq, 3);
- _Seq[0].Name := 's';
- _Seq[0].TC := ORB.CreateTC(Integer(tk_short));
- _Seq[1].Name := 'l';
- _Seq[1].TC := ORB.CreateTC(Integer(tk_long));
- _Seq[2].Name := 'i';
- _Seq[2].TC := DrBob42_c.TIdentifierHelper.TypeCode;
- Result := ORB.MakeStructureTypecode(RepositoryID, 'StructType', _Seq);
- end;
-
- class function TStructTypeHelper.RepositoryId : string;
- begin
- Result := 'IDL:DrBob42/StructType:1.0';
- end;
-
- class function TStructTypeHelper.Read(const _Input : CORBA.InputStream) : DrBob42_i.StructType;
- var
- _Value : DrBob42_c.TStructType;
- begin
- _Value := DrBob42_c.TStructType.Create;
- _Input.ReadShort(_Value.s);
- _Input.ReadLong(_Value.l);
- _Value.i := DrBob42_c.TIdentifierHelper.Read(_Input);
- Result := _Value;
- end;
-
- class procedure TStructTypeHelper.Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.StructType);
- begin
- _Output.WriteShort(_Value.s);
- _Output.WriteLong(_Value.l);
- DrBob42_c.TIdentifierHelper.Write(_Output, _Value.i);
- end;
-
- constructor TStructType.Create;
- begin
- inherited Create;
- end;
-
- constructor TStructType.Create(const s: SmallInt;
- const l: Integer;
- const i: DrBob42_i.Identifier);
- begin
- Self.s := s;
- Self.l := l;
- Self.i := i;
- end;
-
- function TStructType._get_s: SmallInt;
- begin
- Result := s;
- end;
-
- procedure TStructType._set_s(const _Value : SmallInt);
- begin
- s := _Value;
- end;
-
- function TStructType._get_l: Integer;
- begin
- Result := l;
- end;
-
- procedure TStructType._set_l(const _Value : Integer);
- begin
- l := _Value;
- end;
-
- function TStructType._get_i: DrBob42_i.Identifier;
- begin
- Result := i;
- end;
-
- procedure TStructType._set_i(const _Value : DrBob42_i.Identifier);
- begin
- i := _Value;
- end;
-
- class procedure TUnionTypeHelper.Insert(var _A : CORBA.Any; const _Value : DrBob42_i.UnionType);
- var
- _Output : CORBA.OutputStream;
- begin
- _Output := ORB.CreateOutputStream;
- TUnionTypeHelper.Write(_Output, _Value);
- ORB.PutAny(_A, TUnionTypeHelper.TypeCode, _Output);
- end;
-
- class function TUnionTypeHelper.Extract(const _A : CORBA.Any) : DrBob42_i.UnionType;
- var
- _Input : CORBA.InputStream;
- begin
- Orb.GetAny(_A, _Input);
- Result := TUnionTypeHelper.Read(_Input);
- end;
-
- class function TUnionTypeHelper.TypeCode : CORBA.TypeCode;
- var
- Seq: UnionMemberSeq;
- begin
- SetLength(Seq, 3);
- Seq[0].Member_Name := 's';
- Seq[0].Member_Label:= -1;
- Seq[0].Member_TC := ORB.CreateTC(Integer(tk_short));
- Seq[1].Member_Name := 'l';
- Seq[1].Member_Label:= 0;
- Seq[1].Member_TC := ORB.CreateTC(Integer(tk_long));
- Seq[2].Member_Name := 'i';
- Seq[2].Member_Label:= 1;
- Seq[2].Member_TC := DrBob42_c.TIdentifierHelper.TypeCode;
- Result := ORB.CreateUnionTC(RepositoryID, 'UnionType', ORB.CreateTC(Integer(tk_long)), Seq);
- end;
-
- class function TUnionTypeHelper.RepositoryId: string;
- begin
- Result := 'IDL:DrBob42/UnionType:1.0';
- end;
-
- class function TUnionTypeHelper.Read(const _Input: CORBA.InputStream): DrBob42_i.UnionType;
- var
- _Value : DrBob42_c.TUnionType;
- begin
- _Value := TUnionType.Create;
- _Input.ReadLong(_Value._discriminator);
- case _Value._discriminator of
- -1 : _Input.ReadShort(_Value.s);
- 0 : _Input.ReadLong(_Value.l);
- 1 : _Value.i := DrBob42_c.TIdentifierHelper.Read(_Input);
- end;
- Result := _Value;
- end;
-
- class procedure TUnionTypeHelper.Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.UnionType);
- begin
- _Output.WriteLong(_Value._discriminator);
- case _Value._discriminator of
- -1 : _Output.WriteShort(_Value.s);
- 0 : _Output.WriteLong(_Value.l);
- 1 : DrBob42_c.TIdentifierHelper.Write(_Output, _Value.i);
- end;
- end;
-
- constructor TUnionType.Create;
- begin
- Self._discriminator := Integer($80000000);
- end;
-
- function TUnionType._get_discriminator: Integer;
- begin
- Result := _discriminator;
- end;
-
- function TUnionType._get_s: SmallInt;
- begin
- if ( ( _discriminator <> -1 )
- )
- then raise BAD_OPERATION.Create(0, COMPLETED_YES);
- Result := s;
- end;
-
- procedure TUnionType._set_s(const _Value : SmallInt);
- begin
- _discriminator := -1;
- s := _Value;
- end;
-
- function TUnionType._get_l: Integer;
- begin
- if ( ( _discriminator <> 0 )
- )
- then raise BAD_OPERATION.Create(0, COMPLETED_YES);
- Result := l;
- end;
-
- procedure TUnionType._set_l(const _Value : Integer);
- begin
- _discriminator := 0;
- l := _Value;
- end;
-
- function TUnionType._get_i: DrBob42_i.Identifier;
- begin
- if ( ( _discriminator <> 1 )
- )
- then raise BAD_OPERATION.Create(0, COMPLETED_YES);
- Result := i;
- end;
-
- procedure TUnionType._set_i(const _Value : DrBob42_i.Identifier);
- begin
- _discriminator := 1;
- i := _Value;
- end;
-
- class procedure TStructArrayHelper.Insert(var _A: CORBA.Any; const _Value : DrBob42_i.StructArray);
- var
- _Output : CORBA.OutputStream;
- begin
- _Output := ORB.CreateOutputStream;
- TStructArrayHelper.Write(_Output, _Value);
- ORB.PutAny(_A, TStructArrayHelper.TypeCode, _Output);
- end;
-
- class function TStructArrayHelper.Extract(const _A : CORBA.Any): DrBob42_i.StructArray;
- var
- _Input : CORBA.InputStream;
- begin
- Orb.GetAny(_A, _Input);
- Result := TStructArrayHelper.Read(_Input);
- end;
-
- class function TStructArrayHelper.TypeCode: CORBA.TypeCode;
- begin
- Result := ORB.CreateArrayTC(3, DrBob42_c.TStructTypeHelper.TypeCode());
- end;
-
- class function TStructArrayHelper.RepositoryId: string;
- begin
- Result := 'IDL:DrBob42/StructArray:1.0';
- end;
-
- class function TStructArrayHelper.Read(const _Input: CORBA.InputStream) : DrBob42_i.StructArray;
- var
- I0 : Cardinal;
- begin
- for I0 := 0 to 2 do
- begin
- Result[I0] := DrBob42_c.TStructTypeHelper.Read(_Input);
- end;
- end;
-
- class procedure TStructArrayHelper.Write(const _Output: CORBA.OutputStream; const _Value: DrBob42_i.StructArray);
- var
- I0 : Cardinal;
- begin
- for I0 := 0 to 2 do
- begin
- DrBob42_c.TStructTypeHelper.Write(_Output, _Value[I0]);
- end;
- end;
-
- class procedure TStructSequenceHelper.Insert(var _A : CORBA.Any; const _Value : DrBob42_i.StructSequence);
- var
- _Output : CORBA.OutputStream;
- begin
- _Output := ORB.CreateOutputStream;
- TStructSequenceHelper.Write(_Output, _Value);
- ORB.PutAny(_A, TStructSequenceHelper.TypeCode, _Output);
- end;
-
- class function TStructSequenceHelper.Extract(const _A : CORBA.Any): DrBob42_i.StructSequence;
- var
- _Input : InputStream;
- begin
- Orb.GetAny(_A, _Input);
- Result := TStructSequenceHelper.Read(_Input);
- end;
-
- class function TStructSequenceHelper.TypeCode: CORBA.TypeCode;
- begin
- Result := ORB.CreateSequenceTC(0, DrBob42_c.TStructTypeHelper.TypeCode());
- end;
-
- class function TStructSequenceHelper.RepositoryId: string;
- begin
- Result := 'IDL:DrBob42/StructSequence:1.0';
- end;
-
- class function TStructSequenceHelper.Read(const _Input : CORBA.InputStream) : DrBob42_i.StructSequence;
- var
- L0 : Cardinal;
- I0 : Cardinal;
- begin
- _Input.ReadULong(L0);
- SetLength(Result, L0);
- if (L0 > 0) then
- begin
- for I0 := 0 to High(Result) do
- begin
- Result[I0] := DrBob42_c.TStructTypeHelper.Read(_Input);
- end;
- end;
- end;
-
- class procedure TStructSequenceHelper.Write(const _Output: CORBA.OutputStream; const _Value: DrBob42_i.StructSequence);
- var
- L0 : Cardinal;
- I0 : Cardinal;
- begin
- L0 := Length(_Value);
- _Output.WriteULong(L0);
- if (L0 > 0) then
- begin
- for I0 := 0 to High(_Value) do
- begin
- DrBob42_c.TStructTypeHelper.Write(_Output, _Value[I0]);
- end;
- end;
- end;
-
- class procedure TADTHelper.Insert(var _A : CORBA.Any; const _Value : DrBob42_i.ADT);
- begin
- _A := Orb.MakeObjectRef( TADTHelper.TypeCode, _Value as CORBA.CORBAObject);
- end;
-
- class function TADTHelper.Extract(var _A : CORBA.Any): DrBob42_i.ADT;
- var
- _obj : Corba.CorbaObject;
- begin
- _obj := Orb.GetObjectRef(_A);
- Result := TADTHelper.Narrow(_obj, True);
- end;
-
- class function TADTHelper.TypeCode : CORBA.TypeCode;
- begin
- Result := ORB.CreateInterfaceTC(RepositoryId, 'ADT');
- end;
-
- class function TADTHelper.RepositoryId : string;
- begin
- Result := 'IDL:DrBob42/ADT:1.0';
- end;
-
- class function TADTHelper.Read(const _Input : CORBA.InputStream) : DrBob42_i.ADT;
- var
- _Obj : CORBA.CORBAObject;
- begin
- _Input.ReadObject(_Obj);
- Result := Narrow(_Obj, True)
- end;
-
- class procedure TADTHelper.Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.ADT);
- begin
- _Output.WriteObject(_Value as CORBA.CORBAObject);
- end;
-
- class function TADTHelper.Narrow(const _Obj : CORBA.CORBAObject; _IsA : Boolean) : DrBob42_i.ADT;
- begin
- Result := nil;
- if (_Obj = nil) or (_Obj.QueryInterface(DrBob42_i.ADT, Result) = 0) then
- exit;
- if _IsA and _Obj._IsA(RepositoryId) then
- Result := TADTStub.Create(_Obj);
- end;
-
- class function TADTHelper.Bind(const _InstanceName : string = ''; _HostName: string = '') : DrBob42_i.ADT;
- begin
- Result := Narrow(ORB.bind(RepositoryId, _InstanceName, _HostName), True);
- end;
-
- class function TADTHelper.Bind(_Options : BindOptions; const _InstanceName : string = ''; _HostName : string = '') : DrBob42_i.ADT;
- begin
- Result := Narrow(ORB.bind(RepositoryId, _Options, _InstanceName, _HostName), True);
- end;
-
- procedure TADTStub.test ( const one : DrBob42_i.Identifier;
- const two : DrBob42_i.EnumType;
- const three : DrBob42_i.StructType;
- const four : DrBob42_i.UnionType;
- const five : DrBob42_i.StructArray;
- const six : DrBob42_i.StructSequence);
- var
- _Output: CORBA.OutputStream;
- _Input : CORBA.InputStream;
- begin
- inherited _CreateRequest('test',True, _Output);
- DrBob42_c.TIdentifierHelper.Write(_Output, one);
- DrBob42_c.TEnumTypeHelper.Write(_Output, two);
- DrBob42_c.TStructTypeHelper.Write(_Output, three);
- DrBob42_c.TUnionTypeHelper.Write(_Output, four);
- DrBob42_c.TStructArrayHelper.Write(_Output, five);
- DrBob42_c.TStructSequenceHelper.Write(_Output, six);
- inherited _Invoke(_Output, _Input);
- end;
-
- class procedure TIntSeqHelper.Insert(var _A : CORBA.Any; const _Value : DrBob42_i.IntSeq);
- var
- _Output : CORBA.OutputStream;
- begin
- _Output := ORB.CreateOutputStream;
- TIntSeqHelper.Write(_Output, _Value);
- ORB.PutAny(_A, TIntSeqHelper.TypeCode, _Output);
- end;
-
- class function TIntSeqHelper.Extract(const _A : CORBA.Any): DrBob42_i.IntSeq;
- var
- _Input : InputStream;
- begin
- Orb.GetAny(_A, _Input);
- Result := TIntSeqHelper.Read(_Input);
- end;
-
- class function TIntSeqHelper.TypeCode: CORBA.TypeCode;
- begin
- Result := ORB.CreateSequenceTC(5, ORB.CreateTC(Integer(tk_long)));
- end;
-
- class function TIntSeqHelper.RepositoryId: string;
- begin
- Result := 'IDL:DrBob42/IntSeq:1.0';
- end;
-
- class function TIntSeqHelper.Read(const _Input : CORBA.InputStream) : DrBob42_i.IntSeq;
- var
- L0 : Cardinal;
- I0 : Cardinal;
- begin
- _Input.ReadULong(L0);
- if (L0 > 5) then raise MARSHAL.Create(0, COMPLETED_YES);
- if (L0 > 0) then
- begin
- for I0 := 0 to High(Result) do
- begin
- _Input.ReadULong(Result[I0]);
- end;
- end;
- end;
-
- class procedure TIntSeqHelper.Write(const _Output: CORBA.OutputStream; const _Value: DrBob42_i.IntSeq);
- var
- L0 : Cardinal;
- I0 : Cardinal;
- begin
- L0 := Length(_Value);
- if (L0 > 5) then raise MARSHAL.Create(0, COMPLETED_NO);
- _Output.WriteULong(L0);
- if (L0 > 0) then
- begin
- for I0 := 0 to High(_Value) do
- begin
- _Output.WriteULong(_Value[I0]);
- end;
- end;
- end;
-
- class procedure TSeqAccountHelper.Insert(var _A : CORBA.Any; const _Value : DrBob42_i.SeqAccount);
- begin
- _A := Orb.MakeObjectRef( TSeqAccountHelper.TypeCode, _Value as CORBA.CORBAObject);
- end;
-
- class function TSeqAccountHelper.Extract(var _A : CORBA.Any): DrBob42_i.SeqAccount;
- var
- _obj : Corba.CorbaObject;
- begin
- _obj := Orb.GetObjectRef(_A);
- Result := TSeqAccountHelper.Narrow(_obj, True);
- end;
-
- class function TSeqAccountHelper.TypeCode : CORBA.TypeCode;
- begin
- Result := ORB.CreateInterfaceTC(RepositoryId, 'SeqAccount');
- end;
-
- class function TSeqAccountHelper.RepositoryId : string;
- begin
- Result := 'IDL:DrBob42/SeqAccount:1.0';
- end;
-
- class function TSeqAccountHelper.Read(const _Input : CORBA.InputStream) : DrBob42_i.SeqAccount;
- var
- _Obj : CORBA.CORBAObject;
- begin
- _Input.ReadObject(_Obj);
- Result := Narrow(_Obj, True)
- end;
-
- class procedure TSeqAccountHelper.Write(const _Output : CORBA.OutputStream; const _Value : DrBob42_i.SeqAccount);
- begin
- _Output.WriteObject(_Value as CORBA.CORBAObject);
- end;
-
- class function TSeqAccountHelper.Narrow(const _Obj : CORBA.CORBAObject; _IsA : Boolean) : DrBob42_i.SeqAccount;
- begin
- Result := nil;
- if (_Obj = nil) or (_Obj.QueryInterface(DrBob42_i.SeqAccount, Result) = 0) then
- exit;
- if _IsA and _Obj._IsA(RepositoryId) then
- Result := TSeqAccountStub.Create(_Obj);
- end;
-
- class function TSeqAccountHelper.Bind(const _InstanceName : string = ''; _HostName: string = '') : DrBob42_i.SeqAccount;
- begin
- Result := Narrow(ORB.bind(RepositoryId, _InstanceName, _HostName), True);
- end;
-
- class function TSeqAccountHelper.Bind(_Options : BindOptions; const _InstanceName : string = ''; _HostName : string = '') : DrBob42_i.SeqAccount;
- begin
- Result := Narrow(ORB.bind(RepositoryId, _Options, _InstanceName, _HostName), True);
- end;
-
- function TSeqAccountStub.balance ( const mySeq : DrBob42_i.IntSeq): Single;
- var
- _Output: CORBA.OutputStream;
- _Input : CORBA.InputStream;
- begin
- inherited _CreateRequest('balance',True, _Output);
- DrBob42_c.TIntSeqHelper.Write(_Output, mySeq);
- inherited _Invoke(_Output, _Input);
- _Input.ReadFloat(Result);
- end;
-
-
- initialization
- DrBob42_c.AccountExceptionDesc := RegisterUserException('AccountException', 'IDL:DrBob42/AccountException:1.0', @DrBob42_c.AccountException_Factory);
-
-
- finalization
- UnRegisterUserException(DrBob42_c.AccountExceptionDesc);
-
-
- end.